<!DOCTYPE html>
<html data-ng-controller="mainCtrl">
<head lang="zh">
    <meta charset="UTF-8">
    ${require('mypublic/inc/head.html')}
</head>
<body>
${require('mypublic/inc/seajs.html')}
${require('mypublic/inc/top.html')}
${require('@yunke/core/html/server_time.html')}
<div class="layout">
    <!-- 容器 [[-->
    <div class="container">
        <div class="wrap clearfix">
            <div class="pt10">
                ${require('mypublic/inc/left_side.html')}
            </div>
            <div class="content">


                <div>
                    <div>
                        <div class="table-header clearfix ng-scope">
                            <span class="fl lh30 f14 ng-binding">媒体编辑</span>
                        </div>

                        <div id="js_error_msg"></div>

                        <iframe name="js_post_target_iframe" style="display: none;"></iframe>

                        <form class="form-horizontal ng-pristine ng-valid"
                              action="{{action}}" method="post"
                              enctype="multipart/form-data" autocomplete="off"
                              target="js_post_target_iframe"
                        >

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="mediaentity-dir_id">目录</label>
                                </span>
                                <div class="col-sm-5">
                                    <select id="mediaentity-dir_id" class="form-control" name="MediaEntity[dir_id]">
                                        <option
                                                ng-repeat="(key,item) in data.dirs"
                                                value="{{key}}"
                                                ng-selected="{{data.dir_id===key}}"
                                        >
                                            {{item}}
                                        </option>
                                    </select>
                                </div>
                            </div>

                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="mediaentity-name">说明</label>
                                </span>
                                <div class="col-sm-18">
                                    <input type="text" id="mediaentity-name" class="form-control"
                                           name="MediaEntity[name]" ng-value="data.model.name"></div>
                            </div>
                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="mediaentity-status">状态</label>
                                </span>
                                <div class="col-sm-2">
                                    <input type="hidden" name="MediaEntity[status]" ng-value="data.model.status">
                                    <label>
                                        <input
                                                type="checkbox" id="mediaentity-status"
                                                ng-model="statusChecked"
                                                >
                                    </label>
                                </div>
                            </div>
                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    填写资源地址
                                </span>
                                <div class="col-sm-18">
                                    <input type="text" id="mediaentity-file" class="form-control"
                                           name="MediaEntity[file]"
                                           ng-model="data.model.file">
                                </div>
                            </div>
                            <div class="form-group mt10">
                                <span class="col-sm-3 control-label ml15">
                                    <label for="mediaentity-file">资源地址</label>
                                </span>

                                <div class="col-sm-18" ng-if="!data.model.file">
                                    <input type="hidden" name="MediaEntity[resourcesFile]" value="">
                                    <input type="file"
                                           id="mediaentity-resourcesfile"
                                           name="MediaEntity[resourcesFile]"
                                           onchange="fileChange(this)">
                                </div>

                                <div class="col-sm-18" ng-if="data.model.file">
                                    <a href="{{data.model.file}}"
                                       target="_blank">{{data.model.file}}</a>
                                    <div style="width:295px;" id="videoplay">
                                    </div>
                                </div>
                            </div>

                            <div class="form-group">
                                <div class="ml35 mt15">
                                    <button type="submit" id="submit" class="btn btn-default ng-scope"
                                            ng-if="userAuthList.indexOf('0721') !== -1"
                                            ng-click="beforeSubmit()">保存</button>
                                    <a class="btn btn-yellow" href="/official/media_list/index.html">返回列表</a></div>
                            </div>
                        </form>
                    </div>
                </div>


            </div>
        </div>
    </div>
    <!-- 容器 ]]-->
</div>
</body>
${require('@yunke/core/public_menu/footer.html')}
<script type="text/javascript" src="./index.js"></script>
</html>
